<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$课堂练习$</title>
</head>
<body>

<script>
    //1-100的乘积
    var sum = 1;
    for (var i = 1; i <= 100; i++) {
        sum *= i;
    }
    console.log(sum);
    //1-100所有奇数的积
    var sum1 = 0;
    for (var i = 1; i <= 100; i++) {
        if (i % 2 != 0) {
            sum1 += i;
        }
    }
    console.log(sum1);
    //1-100之间能被3整除的和
    var sum2 = 0;
    for (var i = 1; i <= 100; i++) {
        if (i % 3 == 0) {
            sum2 += i;
        }
    }
    console.log(sum2);
    //1-100之间能被7整除的和
    var sum3 = 0;
    for (var i = 1; i <= 100; i++) {
        if (i % 7 != 0) {
            sum3 += i;
        }
    }
    console.log(sum3);
    //本金10000元存入银行，年利率是千分之三，每过一年，将本金和利息相加作为新的本金。计算5年后，获得的本金是多少？
    var sum4 = 10000;
    for (var i = 1; i <= 5; i++) {

        sum4 = sum4 + sum4 * 0.003;
    }
    console.log(parseInt(sum4) + "元");
    //兔子繁殖
    var num1 = 1;
    var num2 = 1;
    var sum5 = 0;
    for (var i = 3; i <= 12; i++) {
        sum5 = num1 + num2;
        num1 = num2;
        num2 = sum5;
    }
    console.log(sum5);
</script>
</body>
</html>